import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutterdemo/2house730page/pages/property_detail_page/property_detail_page.dart';

class HouseListItem extends StatefulWidget {
  @override
  _HouseListItemState createState() => _HouseListItemState();
}

class _HouseListItemState extends State<HouseListItem> {
  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: _houseDetail,
      child: Container(
        height: 500.h,
        child: Padding(
          padding: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.h, bottom: 30.h),
//      padding: EdgeInsets.only(left: 0.w, right: 0.w, top: 0.h, bottom: 0.h),
          child: Column(
            children: <Widget>[
              Row(
                mainAxisAlignment: MainAxisAlignment.start,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: <Widget>[
                  Image.network(
                    "http://pic.sc.chinaz.com/files/pic/pic9/202005/apic25333.jpg",
                    fit: BoxFit.fill,
                    height: 300.h,
                    width: 400.w,
                  ),
                  SizedBox(
                    width: 30.w,
                  ),
                  Expanded(
                    child: Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: <Widget>[
                        Text(
                          "售盘售盘售盘售盘售盘售盘售盘售盘售盘售盘售盘售盘售盘售盘售盘售盘售盘售盘售盘售盘售盘售盘售盘",
                          style: TextStyle(
                            fontSize: 50.sp,
                            color: Colors.black,
                            fontWeight: FontWeight.bold,
                          ),
                          maxLines: 2,
                          textAlign: TextAlign.start,
                          overflow: TextOverflow.ellipsis,
                        ),
                        SizedBox(
                          height: 10.h,
                        ),
                        Text.rich(
                          TextSpan(children: [
                            TextSpan(
                              text: "Home: ",
                              style: TextStyle(color: Colors.blue, fontSize: 40.sp),
                            ),
                            TextSpan(text: "https://flutterchina.club", style: TextStyle(fontSize: 40.sp)),
                          ]),
                          textAlign: TextAlign.start,
                          maxLines: 1,
                          overflow: TextOverflow.ellipsis,
                          textDirection: TextDirection.ltr,
                        ),
                        SizedBox(
                          height: 10.h,
                        ),
                        Row(
                          mainAxisAlignment: MainAxisAlignment.start,
                          crossAxisAlignment: CrossAxisAlignment.center,
                          children: <Widget>[
                            Text("\$1500万",
                                style: TextStyle(
                                  fontSize: 50.sp,
                                  color: Colors.black,
                                  fontWeight: FontWeight.bold,
                                )),
                            SizedBox(
                              width: 15.w,
                            ),
                            Text("330 / 264尺 \n@\$16691 / @\$20067", style: TextStyle(fontSize: 30.sp)),
                          ],
                        )
                      ],
                    ),
                  )
                ],
              ),
              Container(
                  margin: EdgeInsets.only(left: 430.w),
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: <Widget>[
                      SizedBox(
                        height: 30.h,
                      ),
                      Divider(
                        height: 1.1.h,
                      ),
                      SizedBox(
                        height: 30.h,
                      ),
                      Text("XXXX公司", style: TextStyle(fontSize: 40.sp)),
                    ],
                  ))
            ],
          ),
        ),
      ),
    );
  }

  void _houseDetail() {
    print("houseDetail");

    Navigator.of(context).push(MaterialPageRoute(builder: (context) => PropertyDetailPage()));
  }
}
